@formicoidea/labre-core 0.52.0 → 0.54.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.
Files changed (96) hide show
  1. package/dist/_pkgs/affine-block-data-view/data-view-block.js +1 -1
  2. package/dist/_pkgs/affine-block-database/components/title/index.js +7 -2
  3. package/dist/_pkgs/affine-block-database/database-block-styles.js +9 -1
  4. package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.d.ts +70 -0
  5. package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.js +196 -0
  6. package/dist/_pkgs/affine-block-embed-doc/view.js +3 -0
  7. package/dist/_pkgs/affine-block-frame/frame-template.d.ts +11 -0
  8. package/dist/_pkgs/affine-block-frame/frame-template.js +24 -4
  9. package/dist/_pkgs/affine-block-frame/translations.d.ts +3 -0
  10. package/dist/_pkgs/affine-block-frame/translations.js +7 -0
  11. package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +9 -3
  12. package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +9 -5
  13. package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
  14. package/dist/_pkgs/affine-block-surface/index.js +1 -0
  15. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +55 -3
  16. package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +139 -6
  17. package/dist/_pkgs/affine-block-surface/renderer/notation-tint.d.ts +92 -0
  18. package/dist/_pkgs/affine-block-surface/renderer/notation-tint.js +113 -0
  19. package/dist/_pkgs/affine-block-surface/surface-block.js +2 -2
  20. package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
  21. package/dist/_pkgs/affine-components/context-menu/input.js +2 -1
  22. package/dist/_pkgs/affine-components/context-menu/menu-renderer.d.ts +7 -0
  23. package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +53 -13
  24. package/dist/_pkgs/affine-components/drop-indicator/file-drop-manager.js +15 -0
  25. package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +4 -2
  26. package/dist/_pkgs/affine-inline-link/link-node/link-popup/styles.js +1 -1
  27. package/dist/_pkgs/affine-inline-reference/reference-node/reference-popup/reference-popup.js +9 -9
  28. package/dist/_pkgs/affine-shared/consts/notation.d.ts +1 -0
  29. package/dist/_pkgs/affine-shared/consts/notation.js +29 -0
  30. package/dist/_pkgs/affine-shared/services/frame-template-service.d.ts +5 -0
  31. package/dist/_pkgs/affine-shared/services/index.d.ts +1 -0
  32. package/dist/_pkgs/affine-shared/services/index.js +1 -0
  33. package/dist/_pkgs/affine-shared/services/page-drop-service.d.ts +61 -0
  34. package/dist/_pkgs/affine-shared/services/page-drop-service.js +30 -0
  35. package/dist/_pkgs/affine-shared/services/thread-marks-service.d.ts +32 -1
  36. package/dist/_pkgs/affine-shared/styles/scrollbar-style.js +1 -1
  37. package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +5 -5
  38. package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-auto-complete.js +2 -2
  39. package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +6 -6
  40. package/dist/_pkgs/affine-widget-keyboard-toolbar/styles.js +1 -1
  41. package/dist/_pkgs/affine-widget-linked-doc/config.d.ts +8 -0
  42. package/dist/_pkgs/affine-widget-linked-doc/config.js +8 -1
  43. package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +40 -32
  44. package/dist/_pkgs/affine-widget-linked-doc/styles.js +1 -1
  45. package/dist/_pkgs/affine-widget-linked-doc/translations.d.ts +2 -0
  46. package/dist/_pkgs/affine-widget-linked-doc/translations.js +6 -0
  47. package/dist/_pkgs/affine-widget-thread-marks/excerpt.d.ts +6 -2
  48. package/dist/_pkgs/affine-widget-thread-marks/excerpt.js +8 -0
  49. package/dist/_pkgs/affine-widget-thread-marks/index.d.ts +1 -0
  50. package/dist/_pkgs/affine-widget-thread-marks/index.js +1 -0
  51. package/dist/_pkgs/affine-widget-thread-marks/text-range.d.ts +26 -0
  52. package/dist/_pkgs/affine-widget-thread-marks/text-range.js +59 -0
  53. package/dist/_pkgs/affine-widget-thread-marks/toolbar.d.ts +4 -3
  54. package/dist/_pkgs/affine-widget-thread-marks/toolbar.js +24 -8
  55. package/dist/_pkgs/affine-widget-thread-marks/widget.d.ts +33 -2
  56. package/dist/_pkgs/affine-widget-thread-marks/widget.js +121 -5
  57. package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +2 -1
  58. package/dist/_pkgs/affine-widget-toolbar/utils.js +5 -2
  59. package/dist/_pkgs/data-view/core/common/properties.js +2 -2
  60. package/dist/_pkgs/data-view/core/common/property-menu.d.ts +3 -3
  61. package/dist/_pkgs/data-view/core/common/property-menu.js +7 -7
  62. package/dist/_pkgs/data-view/core/component/overflow/overflow.js +4 -1
  63. package/dist/_pkgs/data-view/core/group-by/renderer/base.d.ts +4 -1
  64. package/dist/_pkgs/data-view/core/group-by/renderer/base.js +17 -2
  65. package/dist/_pkgs/data-view/core/group-by/renderer/number-group.js +1 -1
  66. package/dist/_pkgs/data-view/core/group-by/renderer/select-group.d.ts +0 -3
  67. package/dist/_pkgs/data-view/core/group-by/renderer/select-group.js +63 -118
  68. package/dist/_pkgs/data-view/core/group-by/renderer/string-group.js +1 -1
  69. package/dist/_pkgs/data-view/core/group-by/setting.js +2 -2
  70. package/dist/_pkgs/data-view/core/utils/wording.d.ts +6 -2
  71. package/dist/_pkgs/data-view/core/utils/wording.js +5 -3
  72. package/dist/_pkgs/data-view/core/view/default-name.d.ts +6 -0
  73. package/dist/_pkgs/data-view/core/view/default-name.js +8 -0
  74. package/dist/_pkgs/data-view/translations.d.ts +47 -0
  75. package/dist/_pkgs/data-view/translations.js +124 -0
  76. package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.d.ts +3 -1
  77. package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.js +102 -124
  78. package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +4 -2
  79. package/dist/_pkgs/data-view/view-presets/table/mobile/header.js +17 -9
  80. package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +20 -11
  81. package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-style.d.ts +17 -0
  82. package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-style.js +31 -6
  83. package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-ui-logic.js +2 -2
  84. package/dist/_pkgs/data-view/view-presets/table/pc/group.js +4 -2
  85. package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/filter/list-view.d.ts +3 -1
  86. package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/filter/list-view.js +23 -3
  87. package/dist/_pkgs/data-view/widget-presets/tools/presets/search/search.d.ts +3 -0
  88. package/dist/_pkgs/data-view/widget-presets/tools/presets/search/search.js +37 -5
  89. package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.d.ts +3 -0
  90. package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.js +99 -35
  91. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +30 -22
  92. package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +8 -6
  93. package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.js +15 -0
  94. package/dist/host-panels.d.ts +1 -1
  95. package/dist/host-panels.js +2 -1
  96. package/package.json +1 -1
@@ -33,8 +33,11 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
33
  return useValue ? value : void 0;
34
34
  };
35
35
  import { SignalWatcher, WithDisposable } from '../../../../global/lit/index.js';
36
- import { ShadowlessElement } from '../../../../std/index.js';
36
+ import { ShadowlessElement, stdContext } from '../../../../std/index.js';
37
+ import { consume } from '@lit/context';
37
38
  import { property } from 'lit/decorators.js';
39
+ import { DATA_VIEW_UNGROUPED } from '../../../translations.js';
40
+ import { wordingOf } from '../../utils/wording.js';
38
41
  let BaseGroup = (() => {
39
42
  let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
40
43
  let _group_decorators;
@@ -43,13 +46,18 @@ let BaseGroup = (() => {
43
46
  let _readonly_decorators;
44
47
  let _readonly_initializers = [];
45
48
  let _readonly_extraInitializers = [];
49
+ let _std_decorators;
50
+ let _std_initializers = [];
51
+ let _std_extraInitializers = [];
46
52
  return class BaseGroup extends _classSuper {
47
53
  static {
48
54
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
49
55
  _group_decorators = [property({ attribute: false })];
50
56
  _readonly_decorators = [property({ attribute: false })];
57
+ _std_decorators = [consume({ context: stdContext })];
51
58
  __esDecorate(this, null, _group_decorators, { kind: "accessor", name: "group", static: false, private: false, access: { has: obj => "group" in obj, get: obj => obj.group, set: (obj, value) => { obj.group = value; } }, metadata: _metadata }, _group_initializers, _group_extraInitializers);
52
59
  __esDecorate(this, null, _readonly_decorators, { kind: "accessor", name: "readonly", static: false, private: false, access: { has: obj => "readonly" in obj, get: obj => obj.readonly, set: (obj, value) => { obj.readonly = value; } }, metadata: _metadata }, _readonly_initializers, _readonly_extraInitializers);
60
+ __esDecorate(this, null, _std_decorators, { kind: "accessor", name: "std", static: false, private: false, access: { has: obj => "std" in obj, get: obj => obj.std, set: (obj, value) => { obj.std = value; } }, metadata: _metadata }, _std_initializers, _std_extraInitializers);
53
61
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
54
62
  }
55
63
  #group_accessor_storage = __runInitializers(this, _group_initializers, void 0);
@@ -58,6 +66,13 @@ let BaseGroup = (() => {
58
66
  #readonly_accessor_storage = (__runInitializers(this, _group_extraInitializers), __runInitializers(this, _readonly_initializers, void 0));
59
67
  get readonly() { return this.#readonly_accessor_storage; }
60
68
  set readonly(value) { this.#readonly_accessor_storage = value; }
69
+ #std_accessor_storage = (__runInitializers(this, _readonly_extraInitializers), __runInitializers(this, _std_initializers, void 0));
70
+ /** Absent outside an editor host: the wordings read English. */
71
+ get std() { return this.#std_accessor_storage; }
72
+ set std(value) { this.#std_accessor_storage = value; }
73
+ get ungrouped() {
74
+ return wordingOf(this.std)(DATA_VIEW_UNGROUPED);
75
+ }
61
76
  updateData(data) {
62
77
  this.group.manager.updateData(data);
63
78
  }
@@ -75,7 +90,7 @@ let BaseGroup = (() => {
75
90
  }
76
91
  constructor() {
77
92
  super(...arguments);
78
- __runInitializers(this, _readonly_extraInitializers);
93
+ __runInitializers(this, _std_extraInitializers);
79
94
  }
80
95
  };
81
96
  })();
@@ -40,7 +40,7 @@ export class NumberGroupView extends BaseGroup {
40
40
  `; }
41
41
  render() {
42
42
  if (this.value == null) {
43
- return html ` <div>Ungroups</div>`;
43
+ return html ` <div>${this.ungrouped}</div>`;
44
44
  }
45
45
  if (this.value >= 10) {
46
46
  return html ` <div
@@ -1,4 +1,3 @@
1
- import { type BlockStdScope } from '../../../../std/index.js';
2
1
  import type { SelectTag } from '../../logical/index.js';
3
2
  import { BaseGroup } from './base.js';
4
3
  export declare class SelectGroupView extends BaseGroup<string, {
@@ -6,8 +5,6 @@ export declare class SelectGroupView extends BaseGroup<string, {
6
5
  }> {
7
6
  static styles: import("lit").CSSResult;
8
7
  private readonly _click;
9
- /** Absent outside an editor host: the colour names read English. */
10
- accessor std: BlockStdScope;
11
8
  get tag(): {
12
9
  id: string;
13
10
  value: string;
@@ -1,59 +1,41 @@
1
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
- var _, done = false;
7
- for (var i = decorators.length - 1; i >= 0; i--) {
8
- var context = {};
9
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
- if (kind === "accessor") {
14
- if (result === void 0) continue;
15
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
- if (_ = accept(result.get)) descriptor.get = _;
17
- if (_ = accept(result.set)) descriptor.set = _;
18
- if (_ = accept(result.init)) initializers.unshift(_);
19
- }
20
- else if (_ = accept(result)) {
21
- if (kind === "field") initializers.unshift(_);
22
- else descriptor[key] = _;
23
- }
24
- }
25
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
- done = true;
27
- };
28
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
- var useValue = arguments.length > 2;
30
- for (var i = 0; i < initializers.length; i++) {
31
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
- }
33
- return useValue ? value : void 0;
34
- };
35
1
  import { menu, popMenu, popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
36
- import { stdContext } from '../../../../std/index.js';
37
- import { consume } from '@lit/context';
38
2
  import { css, html } from 'lit';
39
3
  import { classMap } from 'lit/directives/class-map.js';
40
4
  import { styleMap } from 'lit/directives/style-map.js';
41
5
  import { selectOptionColorGrid } from '../../component/tags/color-menu.js';
42
6
  import { wordingOf } from '../../utils/wording.js';
43
7
  import { BaseGroup } from './base.js';
44
- let SelectGroupView = (() => {
45
- let _classSuper = BaseGroup;
46
- let _std_decorators;
47
- let _std_initializers = [];
48
- let _std_extraInitializers = [];
49
- return class SelectGroupView extends _classSuper {
50
- static {
51
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
52
- _std_decorators = [consume({ context: stdContext })];
53
- __esDecorate(this, null, _std_decorators, { kind: "accessor", name: "std", static: false, private: false, access: { has: obj => "std" in obj, get: obj => obj.std, set: (obj, value) => { obj.std = value; } }, metadata: _metadata }, _std_initializers, _std_extraInitializers);
54
- if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
55
- }
56
- static { this.styles = css `
8
+ export class SelectGroupView extends BaseGroup {
9
+ constructor() {
10
+ super(...arguments);
11
+ this._click = (e) => {
12
+ if (this.readonly) {
13
+ return;
14
+ }
15
+ e.stopPropagation();
16
+ popMenu(popupTargetFromElement(this), {
17
+ options: {
18
+ items: [
19
+ menu.input({
20
+ initialValue: this.tag?.value ?? '',
21
+ onChange: text => {
22
+ this.updateTag({ value: text });
23
+ },
24
+ }),
25
+ ...selectOptionColorGrid({
26
+ current: this.tag?.color,
27
+ say: wordingOf(this.std),
28
+ std: this.std,
29
+ select: color => {
30
+ this.updateTag({ color });
31
+ },
32
+ }),
33
+ ],
34
+ },
35
+ });
36
+ };
37
+ }
38
+ static { this.styles = css `
57
39
  data-view-group-title-select-view {
58
40
  overflow: hidden;
59
41
  }
@@ -77,78 +59,41 @@ let SelectGroupView = (() => {
77
59
  white-space: nowrap;
78
60
  }
79
61
  `; }
80
- #std_accessor_storage;
81
- /** Absent outside an editor host: the colour names read English. */
82
- get std() { return this.#std_accessor_storage; }
83
- set std(value) { this.#std_accessor_storage = value; }
84
- get tag() {
85
- return this.data.options?.find(v => v.id === this.value);
86
- }
87
- render() {
88
- const tag = this.tag;
89
- if (!tag) {
90
- return html ` <div
62
+ get tag() {
63
+ return this.data.options?.find(v => v.id === this.value);
64
+ }
65
+ render() {
66
+ const tag = this.tag;
67
+ if (!tag) {
68
+ return html ` <div
91
69
  style="font-size: 14px;color: var(--affine-text-primary-color);line-height: 22px;"
92
70
  >
93
- Ungroups
71
+ ${this.ungrouped}
94
72
  </div>`;
95
- }
96
- const style = styleMap({
97
- backgroundColor: tag.color,
98
- });
99
- const classList = classMap({
100
- 'data-view-group-title-select-view': true,
101
- readonly: this.readonly,
102
- });
103
- return html ` <div @click="${this._click}" class="${classList}">
73
+ }
74
+ const style = styleMap({
75
+ backgroundColor: tag.color,
76
+ });
77
+ const classList = classMap({
78
+ 'data-view-group-title-select-view': true,
79
+ readonly: this.readonly,
80
+ });
81
+ return html ` <div @click="${this._click}" class="${classList}">
104
82
  <div class="tag" style="${style}">${tag.value}</div>
105
83
  </div>`;
106
- }
107
- updateTag(tag) {
108
- this.updateData?.({
109
- ...this.data,
110
- options: this.data.options.map(v => {
111
- if (v.id === this.value) {
112
- return {
113
- ...v,
114
- ...tag,
115
- };
116
- }
117
- return v;
118
- }),
119
- });
120
- }
121
- constructor() {
122
- super(...arguments);
123
- this._click = (e) => {
124
- if (this.readonly) {
125
- return;
84
+ }
85
+ updateTag(tag) {
86
+ this.updateData?.({
87
+ ...this.data,
88
+ options: this.data.options.map(v => {
89
+ if (v.id === this.value) {
90
+ return {
91
+ ...v,
92
+ ...tag,
93
+ };
126
94
  }
127
- e.stopPropagation();
128
- popMenu(popupTargetFromElement(this), {
129
- options: {
130
- items: [
131
- menu.input({
132
- initialValue: this.tag?.value ?? '',
133
- onChange: text => {
134
- this.updateTag({ value: text });
135
- },
136
- }),
137
- ...selectOptionColorGrid({
138
- current: this.tag?.color,
139
- say: wordingOf(this.std),
140
- std: this.std,
141
- select: color => {
142
- this.updateTag({ color });
143
- },
144
- }),
145
- ],
146
- },
147
- });
148
- };
149
- this.#std_accessor_storage = __runInitializers(this, _std_initializers, void 0);
150
- __runInitializers(this, _std_extraInitializers);
151
- }
152
- };
153
- })();
154
- export { SelectGroupView };
95
+ return v;
96
+ }),
97
+ });
98
+ }
99
+ }
@@ -36,7 +36,7 @@ export class StringGroupView extends BaseGroup {
36
36
  `; }
37
37
  render() {
38
38
  if (!this.value) {
39
- return html ` <div>Ungroups</div>`;
39
+ return html ` <div>${this.ungrouped}</div>`;
40
40
  }
41
41
  return html ` <div
42
42
  @click="${this._click}"
@@ -91,7 +91,7 @@ let GroupSetting = (() => {
91
91
  width: 4px;
92
92
  height: 12px;
93
93
  border-radius: 1px;
94
- background-color: #efeff0;
94
+ background-color: var(--affine-border-color);
95
95
  position: absolute;
96
96
  left: 4px;
97
97
  top: 0;
@@ -100,7 +100,7 @@ let GroupSetting = (() => {
100
100
  }
101
101
 
102
102
  .group-item:hover .group-item-drag-bar {
103
- background-color: #c0bfc1;
103
+ background-color: var(--affine-placeholder-color);
104
104
  }
105
105
 
106
106
  .group-item-visibility {
@@ -1,6 +1,10 @@
1
- import { type ChromeWording } from '../../../affine-shared/services/index.js';
1
+ import { type ChromeWording, type TranslationParams } from '../../../affine-shared/services/index.js';
2
2
  import type { BlockStdScope } from '../../../std/index.js';
3
- export type Wording = (wording: ChromeWording) => string;
3
+ /**
4
+ * `params` fills `{{name}}` placeholders; the host pluralises on `count`, the
5
+ * English fallback stays neutral.
6
+ */
7
+ export type Wording = (wording: ChromeWording, params?: TranslationParams) => string;
4
8
  /**
5
9
  * Resolve the data-view's wordings through the translation seam when an
6
10
  * editor is there (`stdContext`), in English otherwise (a unit test, a
@@ -1,9 +1,11 @@
1
- import { translateKey, } from '../../../affine-shared/services/index.js';
1
+ import { fillPlaceholders, translateKey, } from '../../../affine-shared/services/index.js';
2
2
  /**
3
3
  * Resolve the data-view's wordings through the translation seam when an
4
4
  * editor is there (`stdContext`), in English otherwise (a unit test, a
5
5
  * standalone mount). A popup renders outside the host, so its opener
6
6
  * resolves the words and hands this function down.
7
7
  */
8
- export const wordingOf = (std) => ([key, fallback]) => std ? translateKey(std, key, fallback) : fallback;
9
- export const englishWording = ([, fallback]) => fallback;
8
+ export const wordingOf = (std) => ([key, fallback], params) => std
9
+ ? translateKey(std, key, fallback, params)
10
+ : fillPlaceholders(fallback, params);
11
+ export const englishWording = ([, fallback], params) => fillPlaceholders(fallback, params);
@@ -1,4 +1,5 @@
1
1
  import type { BlockStdScope } from '../../../std/index.js';
2
+ import type { Wording } from '../utils/wording.js';
2
3
  import type { DataViewModel } from './data-view.js';
3
4
  /**
4
5
  * The name a view created now is given: the preset's `defaultNameKey`
@@ -8,3 +9,8 @@ import type { DataViewModel } from './data-view.js';
8
9
  * and the preset's seed never changes (ADR 0023). Never call it on load.
9
10
  */
10
11
  export declare function viewDefaultName(meta: Pick<DataViewModel, 'model'>, std: BlockStdScope | undefined): string;
12
+ /**
13
+ * A preset's name as a menu shows it (the view settings' "Layout"), through
14
+ * the opener's words; the English `defaultName` without a key.
15
+ */
16
+ export declare function viewPresetName(meta: Pick<DataViewModel, 'model'>, wording: Wording): string;
@@ -12,3 +12,11 @@ export function viewDefaultName(meta, std) {
12
12
  return defaultName;
13
13
  return translateKey(std, defaultNameKey, defaultName);
14
14
  }
15
+ /**
16
+ * A preset's name as a menu shows it (the view settings' "Layout"), through
17
+ * the opener's words; the English `defaultName` without a key.
18
+ */
19
+ export function viewPresetName(meta, wording) {
20
+ const { defaultName, defaultNameKey } = meta.model;
21
+ return defaultNameKey ? wording([defaultNameKey, defaultName]) : defaultName;
22
+ }
@@ -85,5 +85,52 @@ export declare const DATA_VIEW_PROPERTY_HIDE_IN_VIEW: ChromeWording;
85
85
  * property's menu.
86
86
  */
87
87
  export declare const DATA_VIEW_PROPERTY_TYPE: ChromeWording;
88
+ /** The toolbar button and a group's footer row that add a row. */
89
+ export declare const DATA_VIEW_NEW_RECORD: ChromeWording;
90
+ /** The same button on a phone, where the toolbar has no room for two words. */
91
+ export declare const DATA_VIEW_NEW_RECORD_SHORT: ChromeWording;
92
+ /**
93
+ * The title of the group holding the rows with no value. Display only: the
94
+ * stored group key stays `'Ungroups'` (`core/group-by/define.ts`).
95
+ */
96
+ export declare const DATA_VIEW_UNGROUPED: ChromeWording;
97
+ /** The filter bar's button, and the filter group panel's. */
98
+ export declare const DATA_VIEW_ADD_FILTER: ChromeWording;
99
+ export declare const DATA_VIEW_SEARCH_PLACEHOLDER: ChromeWording;
100
+ /** Read after an "Esc" key cap in the search box's clear tooltip. */
101
+ export declare const DATA_VIEW_SEARCH_CLEAR_HINT: ChromeWording;
102
+ /** The title of the view's settings (its "..." button). */
103
+ export declare const DATA_VIEW_VIEW_SETTINGS: ChromeWording;
104
+ /**
105
+ * The view settings' entries. "Layout" and "Group" are the full page's
106
+ * "This view" entries for the same settings (`VIEW_MENU_LAYOUT`,
107
+ * `VIEW_MENU_GROUP` in `@labre/core-database`): one chrome word, one key,
108
+ * declared here because core draws them too.
109
+ */
110
+ export declare const DATA_VIEW_LAYOUT: ChromeWording;
111
+ export declare const DATA_VIEW_GROUP: ChromeWording;
112
+ /**
113
+ * The selection pane's "Filter" (`@labre/affine-widget-edgeless-toolbar`):
114
+ * one chrome word, one key, declared there, so not listed below.
115
+ */
116
+ export declare const DATA_VIEW_FILTER: ChromeWording;
117
+ export declare const DATA_VIEW_SORT: ChromeWording;
118
+ /** Beside "Properties": how many the view shows (`count`). */
119
+ export declare const DATA_VIEW_PROPERTIES_SHOWN: ChromeWording;
120
+ /** Beside "Filter" and "Sort": how many the view has (`count`, 1 or more). */
121
+ export declare const DATA_VIEW_FILTER_COUNT: ChromeWording;
122
+ export declare const DATA_VIEW_SORT_COUNT: ChromeWording;
123
+ /** The title of a property's menu on a phone (its column header). */
124
+ export declare const DATA_VIEW_PROPERTY_SETTINGS: ChromeWording;
125
+ /** A property's menu: the name field's placeholder. */
126
+ export declare const DATA_VIEW_PROPERTY_NAME: ChromeWording;
127
+ /** A property's menu: the entry opening the type picker. */
128
+ export declare const DATA_VIEW_PROPERTY_TYPE_ENTRY: ChromeWording;
129
+ /**
130
+ * The table header's menu: a new property beside this one. Its "Move left"
131
+ * and "Move right" are the views bar's (`VIEWS_BAR_MOVE_LEFT`, `…_RIGHT`).
132
+ */
133
+ export declare const DATA_VIEW_INSERT_LEFT: ChromeWording;
134
+ export declare const DATA_VIEW_INSERT_RIGHT: ChromeWording;
88
135
  /** Walked by `PACKAGE_WORDINGS` in `packages/affine/all/src/translations.ts`. */
89
136
  export declare const DATA_VIEW_WORDINGS: readonly ChromeWording[];
@@ -218,11 +218,123 @@ export const DATA_VIEW_PROPERTY_TYPE = [
218
218
  'com.labre.data-view.property.type',
219
219
  'Property type',
220
220
  ];
221
+ /* ── The table's chrome on every device (P7, mobile base views) ──────── */
222
+ /** The toolbar button and a group's footer row that add a row. */
223
+ export const DATA_VIEW_NEW_RECORD = [
224
+ 'com.labre.data-view.new-record',
225
+ 'New Record',
226
+ ];
227
+ /** The same button on a phone, where the toolbar has no room for two words. */
228
+ export const DATA_VIEW_NEW_RECORD_SHORT = [
229
+ 'com.labre.data-view.new-record.short',
230
+ 'New',
231
+ ];
232
+ /**
233
+ * The title of the group holding the rows with no value. Display only: the
234
+ * stored group key stays `'Ungroups'` (`core/group-by/define.ts`).
235
+ */
236
+ export const DATA_VIEW_UNGROUPED = [
237
+ 'com.labre.data-view.group.ungrouped',
238
+ 'Ungroups',
239
+ ];
240
+ /** The filter bar's button, and the filter group panel's. */
241
+ export const DATA_VIEW_ADD_FILTER = [
242
+ 'com.labre.data-view.filter.add',
243
+ 'Add filter',
244
+ ];
245
+ export const DATA_VIEW_SEARCH_PLACEHOLDER = [
246
+ 'com.labre.data-view.search.placeholder',
247
+ 'Search...',
248
+ ];
249
+ /** Read after an "Esc" key cap in the search box's clear tooltip. */
250
+ export const DATA_VIEW_SEARCH_CLEAR_HINT = [
251
+ 'com.labre.data-view.search.clear-hint',
252
+ 'to clear all',
253
+ ];
254
+ /* ── The view settings and a property's settings (P7, phone sheets) ──── */
255
+ /** The title of the view's settings (its "..." button). */
256
+ export const DATA_VIEW_VIEW_SETTINGS = [
257
+ 'com.labre.data-view.view-settings',
258
+ 'View settings',
259
+ ];
260
+ /**
261
+ * The view settings' entries. "Layout" and "Group" are the full page's
262
+ * "This view" entries for the same settings (`VIEW_MENU_LAYOUT`,
263
+ * `VIEW_MENU_GROUP` in `@labre/core-database`): one chrome word, one key,
264
+ * declared here because core draws them too.
265
+ */
266
+ export const DATA_VIEW_LAYOUT = [
267
+ 'com.labre.database.view-menu.layout',
268
+ 'Layout',
269
+ ];
270
+ export const DATA_VIEW_GROUP = [
271
+ 'com.labre.database.view-menu.group',
272
+ 'Group',
273
+ ];
274
+ /**
275
+ * The selection pane's "Filter" (`@labre/affine-widget-edgeless-toolbar`):
276
+ * one chrome word, one key, declared there, so not listed below.
277
+ */
278
+ export const DATA_VIEW_FILTER = [
279
+ 'com.labre.selection-pane.filter',
280
+ 'Filter',
281
+ ];
282
+ export const DATA_VIEW_SORT = [
283
+ 'com.labre.data-view.sort',
284
+ 'Sort',
285
+ ];
286
+ /** Beside "Properties": how many the view shows (`count`). */
287
+ export const DATA_VIEW_PROPERTIES_SHOWN = [
288
+ 'com.labre.data-view.properties.shown',
289
+ '{{count}} shown',
290
+ ];
291
+ /** Beside "Filter" and "Sort": how many the view has (`count`, 1 or more). */
292
+ export const DATA_VIEW_FILTER_COUNT = [
293
+ 'com.labre.data-view.filter.count',
294
+ '{{count}} filter(s)',
295
+ ];
296
+ export const DATA_VIEW_SORT_COUNT = [
297
+ 'com.labre.data-view.sort.count',
298
+ '{{count}} sort(s)',
299
+ ];
300
+ /** The title of a property's menu on a phone (its column header). */
301
+ export const DATA_VIEW_PROPERTY_SETTINGS = [
302
+ 'com.labre.data-view.property.settings',
303
+ 'Property settings',
304
+ ];
305
+ /** A property's menu: the name field's placeholder. */
306
+ export const DATA_VIEW_PROPERTY_NAME = [
307
+ 'com.labre.data-view.property.name',
308
+ 'Property name',
309
+ ];
310
+ /** A property's menu: the entry opening the type picker. */
311
+ export const DATA_VIEW_PROPERTY_TYPE_ENTRY = [
312
+ 'com.labre.data-view.property.type-entry',
313
+ 'Type',
314
+ ];
315
+ /**
316
+ * The table header's menu: a new property beside this one. Its "Move left"
317
+ * and "Move right" are the views bar's (`VIEWS_BAR_MOVE_LEFT`, `…_RIGHT`).
318
+ */
319
+ export const DATA_VIEW_INSERT_LEFT = [
320
+ 'com.labre.data-view.property.insert-left',
321
+ 'Insert left column',
322
+ ];
323
+ export const DATA_VIEW_INSERT_RIGHT = [
324
+ 'com.labre.data-view.property.insert-right',
325
+ 'Insert right column',
326
+ ];
221
327
  /** Walked by `PACKAGE_WORDINGS` in `packages/affine/all/src/translations.ts`. */
222
328
  export const DATA_VIEW_WORDINGS = [
223
329
  VIEW_SHOWN_AS_TABLE,
224
330
  VIEW_DUPLICATE_AS_TABLE,
225
331
  DATA_VIEW_NEW_PAGE,
332
+ DATA_VIEW_NEW_RECORD,
333
+ DATA_VIEW_NEW_RECORD_SHORT,
334
+ DATA_VIEW_UNGROUPED,
335
+ DATA_VIEW_ADD_FILTER,
336
+ DATA_VIEW_SEARCH_PLACEHOLDER,
337
+ DATA_VIEW_SEARCH_CLEAR_HINT,
226
338
  VIEW_NAME_TABLE,
227
339
  VIEW_NAME_KANBAN,
228
340
  VIEW_NAME_CALENDAR,
@@ -258,4 +370,16 @@ export const DATA_VIEW_WORDINGS = [
258
370
  DATA_VIEW_NEW_PROPERTY,
259
371
  DATA_VIEW_PROPERTY_TYPE,
260
372
  DATA_VIEW_PROPERTY_HIDE_IN_VIEW,
373
+ DATA_VIEW_VIEW_SETTINGS,
374
+ DATA_VIEW_LAYOUT,
375
+ DATA_VIEW_GROUP,
376
+ DATA_VIEW_SORT,
377
+ DATA_VIEW_PROPERTIES_SHOWN,
378
+ DATA_VIEW_FILTER_COUNT,
379
+ DATA_VIEW_SORT_COUNT,
380
+ DATA_VIEW_PROPERTY_SETTINGS,
381
+ DATA_VIEW_PROPERTY_NAME,
382
+ DATA_VIEW_PROPERTY_TYPE_ENTRY,
383
+ DATA_VIEW_INSERT_LEFT,
384
+ DATA_VIEW_INSERT_RIGHT,
261
385
  ];
@@ -1,4 +1,4 @@
1
- import { ShadowlessElement } from '../../../../std/index.js';
1
+ import { type BlockStdScope, ShadowlessElement } from '../../../../std/index.js';
2
2
  import type { TableProperty, TableSingleView } from '../table-view-manager.js';
3
3
  declare const MobileTableColumnHeader_base: typeof ShadowlessElement & import("../../../../global/utils/types.js").Constructor<import("../../../../global/lit/with-disposable.js").DisposableClass>;
4
4
  export declare class MobileTableColumnHeader extends MobileTableColumnHeader_base {
@@ -7,6 +7,8 @@ export declare class MobileTableColumnHeader extends MobileTableColumnHeader_bas
7
7
  editTitle: () => void;
8
8
  private popMenu;
9
9
  render(): import("lit-html").TemplateResult;
10
+ /** Absent outside an editor host: the menu reads English. */
11
+ accessor std: BlockStdScope;
10
12
  accessor column: TableProperty;
11
13
  accessor tableViewManager: TableSingleView;
12
14
  }