@formicoidea/labre-core 1.1.0 → 2.1.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/architecture/code.c4 +37 -34
- package/dist/_pkgs/affine-components/context-menu/input.d.ts +6 -0
- package/dist/_pkgs/affine-components/context-menu/input.js +3 -0
- package/dist/_pkgs/affine-components/context-menu/menu-all.d.ts +1 -0
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.d.ts +3 -1
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +9 -1
- package/dist/_pkgs/affine-components/context-menu/menu.d.ts +7 -0
- package/dist/_pkgs/affine-components/context-menu/menu.js +5 -0
- package/dist/_pkgs/affine-components/context-menu/sub-menu.d.ts +16 -1
- package/dist/_pkgs/affine-components/context-menu/sub-menu.js +32 -5
- package/dist/_pkgs/affine-database-block/configs/slash-menu.js +14 -6
- package/dist/_pkgs/affine-database-block/database-block-styles.js +4 -3
- package/dist/_pkgs/affine-database-block/database-block.js +6 -18
- package/dist/_pkgs/affine-database-block/database-dnd-preview-block.js +5 -1
- package/dist/_pkgs/affine-database-block/detail-panel/block-renderer.js +5 -2
- package/dist/_pkgs/affine-database-block/detail-panel/note-renderer.js +3 -2
- package/dist/_pkgs/affine-database-block/external-data-source.d.ts +10 -0
- package/dist/_pkgs/affine-database-block/external-data-source.js +24 -0
- package/dist/_pkgs/affine-database-block/properties/created-time/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/link/cell-renderer.js +3 -2
- package/dist/_pkgs/affine-database-block/properties/link/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/rich-text/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/text/hosted.js +1 -0
- package/dist/_pkgs/affine-database-block/properties/title/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/title/hosted.js +1 -0
- package/dist/_pkgs/affine-database-block/service/new-row-menu.d.ts +1 -1
- package/dist/_pkgs/affine-database-block/service/new-row-menu.js +1 -1
- package/dist/_pkgs/affine-database-block/translations.d.ts +11 -0
- package/dist/_pkgs/affine-database-block/translations.js +57 -0
- package/dist/_pkgs/affine-database-block/views/index.d.ts +7 -9
- package/dist/_pkgs/affine-database-block/views/index.js +7 -10
- package/dist/_pkgs/affine-database-engine/core/common/properties.js +7 -7
- package/dist/_pkgs/affine-database-engine/core/common/property-menu.d.ts +18 -2
- package/dist/_pkgs/affine-database-engine/core/common/property-menu.js +78 -27
- package/dist/_pkgs/affine-database-engine/core/data-source/base.d.ts +11 -0
- package/dist/_pkgs/affine-database-engine/core/data-source/base.js +3 -0
- package/dist/_pkgs/affine-database-engine/core/detail/detail.js +8 -5
- package/dist/_pkgs/affine-database-engine/core/detail/field.js +14 -7
- package/dist/_pkgs/affine-database-engine/core/filter/add-filter.js +4 -2
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/boolean.js +7 -4
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/create.d.ts +9 -1
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/create.js +2 -0
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/date.js +7 -4
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/multi-tag.js +17 -8
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/number.js +6 -6
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/string.js +19 -12
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/tag.js +9 -4
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/unknown.js +7 -4
- package/dist/_pkgs/affine-database-engine/core/filter/literal/define.js +6 -4
- package/dist/_pkgs/affine-database-engine/core/filter/literal/matcher.d.ts +2 -1
- package/dist/_pkgs/affine-database-engine/core/filter/literal/matcher.js +3 -2
- package/dist/_pkgs/affine-database-engine/core/filter/literal/types.d.ts +4 -1
- package/dist/_pkgs/affine-database-engine/core/filter/literal/types.js +1 -1
- package/dist/_pkgs/affine-database-engine/core/group-by/define.js +11 -9
- package/dist/_pkgs/affine-database-engine/core/group-by/group-title.js +16 -6
- package/dist/_pkgs/affine-database-engine/core/group-by/locate-row.d.ts +16 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/locate-row.js +32 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/renderer/date-group.js +10 -3
- package/dist/_pkgs/affine-database-engine/core/group-by/setting.d.ts +2 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/setting.js +40 -28
- package/dist/_pkgs/affine-database-engine/core/group-by/trait.d.ts +3 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/trait.js +8 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/types.d.ts +3 -1
- package/dist/_pkgs/affine-database-engine/core/group-by/types.js +1 -1
- package/dist/_pkgs/affine-database-engine/core/property/types.d.ts +7 -0
- package/dist/_pkgs/affine-database-engine/core/property/types.js +1 -1
- package/dist/_pkgs/affine-database-engine/core/sort/add-sort.js +3 -1
- package/dist/_pkgs/affine-database-engine/core/statistics/any.js +43 -21
- package/dist/_pkgs/affine-database-engine/core/statistics/checkbox.js +29 -14
- package/dist/_pkgs/affine-database-engine/core/statistics/number.js +54 -31
- package/dist/_pkgs/affine-database-engine/core/statistics/types.d.ts +8 -0
- package/dist/_pkgs/affine-database-engine/core/statistics/types.js +2 -1
- package/dist/_pkgs/affine-database-engine/core/utils/wording.d.ts +20 -1
- package/dist/_pkgs/affine-database-engine/core/utils/wording.js +24 -0
- package/dist/_pkgs/affine-database-engine/core/view-manager/property.d.ts +7 -0
- package/dist/_pkgs/affine-database-engine/core/view-manager/property.js +29 -5
- package/dist/_pkgs/affine-database-engine/core/view-manager/single-view.d.ts +14 -0
- package/dist/_pkgs/affine-database-engine/core/view-manager/single-view.js +11 -0
- package/dist/_pkgs/affine-database-engine/property-presets/checkbox/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/date/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/multi-select/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/number/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/number/utils/formats.d.ts +3 -0
- package/dist/_pkgs/affine-database-engine/property-presets/number/utils/formats.js +56 -9
- package/dist/_pkgs/affine-database-engine/property-presets/progress/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/select/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/text/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/translations.d.ts +133 -5
- package/dist/_pkgs/affine-database-engine/translations.js +625 -9
- package/dist/_pkgs/affine-database-engine/view-presets/convert.js +0 -28
- package/dist/_pkgs/affine-database-engine/view-presets/effect.js +0 -2
- package/dist/_pkgs/affine-database-engine/view-presets/flat/flat-converts.js +2 -4
- package/dist/_pkgs/affine-database-engine/view-presets/flat/flat-view-ui.d.ts +57 -0
- package/dist/_pkgs/affine-database-engine/view-presets/flat/flat-view-ui.js +113 -4
- package/dist/_pkgs/affine-database-engine/view-presets/gallery/gallery-view.js +2 -1
- package/dist/_pkgs/affine-database-engine/view-presets/index.d.ts +0 -2
- package/dist/_pkgs/affine-database-engine/view-presets/index.js +0 -3
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/kanban-view-manager.js +2 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/group.js +7 -5
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/kanban-view-ui-logic.d.ts +5 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/kanban-view-ui-logic.js +25 -3
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/menu.js +12 -6
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/controller/selection.d.ts +8 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/controller/selection.js +35 -12
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/group.js +7 -5
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/header.js +5 -1
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/kanban-view-ui-logic.d.ts +5 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/kanban-view-ui-logic.js +8 -4
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/menu.js +12 -6
- package/dist/_pkgs/affine-database-engine/view-presets/list/list-view.js +2 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/column-header.js +6 -4
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/group.js +6 -5
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/header.js +2 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/table-view-ui-logic.d.ts +4 -3
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/table-view-ui-logic.js +29 -5
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/controller/clipboard.js +6 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/controller/selection.js +2 -0
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/group.js +6 -5
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/header/column-header.js +11 -7
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/header/database-header-column.js +16 -12
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/header/number-format-bar.js +4 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/menu.js +9 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/table-view-ui-logic.d.ts +8 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/table-view-ui-logic.js +29 -7
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/controller/clipboard.js +6 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/controller/selection.js +2 -0
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/bottom/group-footer.js +5 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.d.ts +1 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.js +14 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/group-header.js +5 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/group-title.js +5 -3
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/header/column-header.js +17 -10
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/header/number-format-bar.js +4 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/header/single-column-header.js +20 -14
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/row/menu.js +9 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/table-view-ui-logic.d.ts +6 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/table-view-ui-logic.js +30 -3
- package/dist/_pkgs/affine-database-engine/view-presets/table/stats/column-stats-column.d.ts +1 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/stats/column-stats-column.js +14 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/table-view-manager.js +2 -0
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/condition-view.d.ts +2 -0
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/condition-view.js +13 -6
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/group-panel-view.js +20 -13
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/root-panel-view.js +10 -5
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/sort/root-panel.js +8 -5
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/search/search.js +2 -2
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/table-add-row/add-row.d.ts +6 -0
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/table-add-row/add-row.js +49 -4
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/view-options/view-settings.d.ts +3 -3
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/view-options/view-settings.js +3 -3
- package/dist/_pkgs/affine-database-engine/widget-presets/views-bar/views-view.js +5 -0
- package/dist/_pkgs/affine-database-view-block/configs/slash-menu.js +6 -3
- package/dist/_pkgs/affine-database-view-block/data-view-block.js +5 -4
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.d.ts +3 -2
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +3 -2
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +67 -2
- package/package.json +1 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/calendar-view-manager.d.ts +0 -70
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/calendar-view-manager.js +0 -449
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/define.d.ts +0 -10
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/define.js +0 -29
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/effect.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/effect.js +0 -4
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/index.d.ts +0 -6
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/index.js +0 -6
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/layout.d.ts +0 -37
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/layout.js +0 -138
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/actions.d.ts +0 -7
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/actions.js +0 -64
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/dnd.d.ts +0 -32
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/dnd.js +0 -159
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/effect.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/effect.js +0 -7
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/hit-test.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/hit-test.js +0 -28
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/styles.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/styles.js +0 -707
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/view.d.ts +0 -89
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/view.js +0 -849
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/renderer.d.ts +0 -2
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/renderer.js +0 -8
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/source.d.ts +0 -8
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/source.js +0 -3
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/types.d.ts +0 -79
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/types.js +0 -1
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { FeatureFlagService } from '../../affine-shared/services/index.js';
|
|
1
|
+
import { FeatureFlagService, BLOCK_TYPE_TODO_LIST, } from '../../affine-shared/services/index.js';
|
|
2
2
|
import { isInsideBlockByFlavour } from '../../affine-shared/utils/index.js';
|
|
3
3
|
import {} from '../../affine-widget-slash-menu/index.js';
|
|
4
4
|
import { viewDefaultName } from '../../affine-database-engine/index.js';
|
|
5
5
|
import { DatabaseTableViewIcon } from '@blocksuite/icons/lit';
|
|
6
6
|
import { ToDoListTooltip } from './tooltips.js';
|
|
7
|
+
import { DATABASE_SLASH_TODO } from '../../affine-database-block/translations.js';
|
|
7
8
|
export const dataViewSlashMenuConfig = {
|
|
8
9
|
disableWhen: ({ model }) => {
|
|
9
10
|
return model.flavour === 'affine:data-view';
|
|
10
11
|
},
|
|
11
12
|
items: [
|
|
12
13
|
{
|
|
13
|
-
name:
|
|
14
|
+
name: DATABASE_SLASH_TODO[1],
|
|
15
|
+
nameWording: DATABASE_SLASH_TODO,
|
|
14
16
|
searchAlias: ['todo view'],
|
|
15
17
|
icon: DatabaseTableViewIcon(),
|
|
16
18
|
tooltip: {
|
|
17
19
|
figure: ToDoListTooltip,
|
|
18
|
-
caption:
|
|
20
|
+
caption: BLOCK_TYPE_TODO_LIST[1],
|
|
21
|
+
captionWording: BLOCK_TYPE_TODO_LIST,
|
|
19
22
|
},
|
|
20
23
|
group: '7_Database@1',
|
|
21
24
|
when: ({ model, std }) => !isInsideBlockByFlavour(model.store, model, 'affine:edgeless-text') &&
|
|
@@ -5,7 +5,7 @@ import { CopyIcon, DeleteIcon } from '../affine-components/icons/index.js';
|
|
|
5
5
|
import { PeekViewProvider } from '../affine-components/peek/index.js';
|
|
6
6
|
import { toast } from '../affine-components/toast/index.js';
|
|
7
7
|
import { EDGELESS_TOP_CONTENTEDITABLE_SELECTOR } from '../affine-shared/consts/index.js';
|
|
8
|
-
import { DocModeProvider, NotificationProvider, TelemetryProvider, } from '../affine-shared/services/index.js';
|
|
8
|
+
import { DocModeProvider, NotificationProvider, TelemetryProvider, DOC_UNTITLED, TOOLBAR_COPY, translateKey, } from '../affine-shared/services/index.js';
|
|
9
9
|
import { createRecordDetail, createUniComponentFromWebComponent, dataViewCommonStyle, DataViewRootUILogic, defineUniComponent, renderUniLit, uniMap, } from '../affine-database-engine/index.js';
|
|
10
10
|
import { widgetPresets } from '../affine-database-engine/widget-presets/index.js';
|
|
11
11
|
import { MoreHorizontalIcon } from '@blocksuite/icons/lit';
|
|
@@ -16,6 +16,7 @@ import { computed, signal } from '@preact/signals-core';
|
|
|
16
16
|
import { css, nothing, unsafeCSS } from 'lit';
|
|
17
17
|
import { html } from 'lit/static-html.js';
|
|
18
18
|
import { BlockQueryDataSource } from './data-source.js';
|
|
19
|
+
import { DATABASE_DELETE } from '../affine-database-block/translations.js';
|
|
19
20
|
export class DataViewBlockComponent extends CaptionedBlockComponent {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
@@ -25,14 +26,14 @@ export class DataViewBlockComponent extends CaptionedBlockComponent {
|
|
|
25
26
|
items: [
|
|
26
27
|
menu.input({
|
|
27
28
|
initialValue: this.model.props.title,
|
|
28
|
-
placeholder:
|
|
29
|
+
placeholder: translateKey(this.std, ...DOC_UNTITLED),
|
|
29
30
|
onChange: text => {
|
|
30
31
|
this.model.props.title = text;
|
|
31
32
|
},
|
|
32
33
|
}),
|
|
33
34
|
menu.action({
|
|
34
35
|
prefix: CopyIcon,
|
|
35
|
-
name:
|
|
36
|
+
name: translateKey(this.std, ...TOOLBAR_COPY),
|
|
36
37
|
select: () => {
|
|
37
38
|
const slice = Slice.fromModels(this.store, [this.model]);
|
|
38
39
|
this.std.clipboard.copySlice(slice).catch(console.error);
|
|
@@ -46,7 +47,7 @@ export class DataViewBlockComponent extends CaptionedBlockComponent {
|
|
|
46
47
|
class: {
|
|
47
48
|
'delete-item': true,
|
|
48
49
|
},
|
|
49
|
-
name:
|
|
50
|
+
name: translateKey(this.std, ...DATABASE_DELETE),
|
|
50
51
|
select: () => {
|
|
51
52
|
this.model.children.slice().forEach(block => {
|
|
52
53
|
this.store.deleteBlock(block);
|
|
@@ -8,8 +8,9 @@ export declare class DocTitle extends DocTitle_base {
|
|
|
8
8
|
* Leaves the title for `bodyBlockId`: the title loses the caret (its text
|
|
9
9
|
* is already stored, so that is all "validating" it means), then the block
|
|
10
10
|
* takes the caret where it can, through its `focusFirstCell` (a database
|
|
11
|
-
* block's: the first cell of a table
|
|
12
|
-
*
|
|
11
|
+
* block's: the first cell of a table, the first card's or row's title in
|
|
12
|
+
* editing on a kanban, a gallery or a list). A block without one, or a
|
|
13
|
+
* view without rows, keeps nothing focused. Writes nothing.
|
|
13
14
|
*/
|
|
14
15
|
private _leaveForBodyBlock;
|
|
15
16
|
private readonly _onTitleKeyDown;
|
|
@@ -171,8 +171,9 @@ let DocTitle = (() => {
|
|
|
171
171
|
* Leaves the title for `bodyBlockId`: the title loses the caret (its text
|
|
172
172
|
* is already stored, so that is all "validating" it means), then the block
|
|
173
173
|
* takes the caret where it can, through its `focusFirstCell` (a database
|
|
174
|
-
* block's: the first cell of a table
|
|
175
|
-
*
|
|
174
|
+
* block's: the first cell of a table, the first card's or row's title in
|
|
175
|
+
* editing on a kanban, a gallery or a list). A block without one, or a
|
|
176
|
+
* view without rows, keeps nothing focused. Writes nothing.
|
|
176
177
|
*/
|
|
177
178
|
_leaveForBodyBlock(std, blockId) {
|
|
178
179
|
this.inlineEditor?.setInlineRange(null);
|
|
@@ -128,6 +128,48 @@ export interface DataSourcePickerViewRef {
|
|
|
128
128
|
docId: string;
|
|
129
129
|
blockId: string;
|
|
130
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* What a host locks on one of its sources (ADR 0035 amendment of
|
|
133
|
+
* 2026-10-29, "a host may lock a source's properties and its new rows").
|
|
134
|
+
* Both apply to every view, in every document, that reads the source; a
|
|
135
|
+
* read-only document is read-only whatever they say.
|
|
136
|
+
*/
|
|
137
|
+
export interface DataSourcePickerSourcePolicy {
|
|
138
|
+
/**
|
|
139
|
+
* No property of the source is added, renamed, deleted, duplicated or
|
|
140
|
+
* changed in type, from any menu, button or shortcut. What one view does
|
|
141
|
+
* with a property (hide, order, width, filter, sort, group, colour rules)
|
|
142
|
+
* and every cell value stay editable, select options included.
|
|
143
|
+
*/
|
|
144
|
+
propertiesLocked: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* No row is added to the source ("New" and its menu, every "+", the
|
|
147
|
+
* keyboard's new row). Existing rows stay editable and deletable.
|
|
148
|
+
*/
|
|
149
|
+
rowsLocked: boolean;
|
|
150
|
+
}
|
|
151
|
+
/** The host's word on a name typed for a new source. */
|
|
152
|
+
export type DataSourcePickerSourceNameVerdict = 'ok' | 'empty' | 'taken';
|
|
153
|
+
/**
|
|
154
|
+
* How a new source is named (ADR 0035 amendment of 2026-10-30, "a new
|
|
155
|
+
* source is named in the menu"): the rule is the host's, the library only
|
|
156
|
+
* draws the step.
|
|
157
|
+
*/
|
|
158
|
+
export interface DataSourcePickerSourceNaming {
|
|
159
|
+
/**
|
|
160
|
+
* The name the field opens with, called once each time the naming step
|
|
161
|
+
* opens. It may resolve late (read your names first); a rejection opens
|
|
162
|
+
* the field empty.
|
|
163
|
+
*/
|
|
164
|
+
suggest(): string | Promise<string>;
|
|
165
|
+
/**
|
|
166
|
+
* Your verdict on `name`, as typed (untrimmed), on every keystroke: only
|
|
167
|
+
* `'ok'` creates. Called after `suggest` has settled, so a list `suggest`
|
|
168
|
+
* read is there to check against. MUST return synchronously and MUST NOT
|
|
169
|
+
* throw; a throw reads as `'empty'`.
|
|
170
|
+
*/
|
|
171
|
+
check(name: string): DataSourcePickerSourceNameVerdict;
|
|
172
|
+
}
|
|
131
173
|
/** What `deleteView` hands the host: the view, and the verb that removes it. */
|
|
132
174
|
export interface DataSourcePickerViewDeletion extends DataSourcePickerViewRef {
|
|
133
175
|
/** The view's name, as stored ('' when it has none). */
|
|
@@ -162,7 +204,7 @@ export interface DataSourcePickerService {
|
|
|
162
204
|
* switch, and the creating slash entries ("Table View", "Kanban View")
|
|
163
205
|
* leave the menu.
|
|
164
206
|
*/
|
|
165
|
-
createDatabase?(): Promise<DataSourcePickerDatabase | null>;
|
|
207
|
+
createDatabase?(sourceName?: string): Promise<DataSourcePickerDatabase | null>;
|
|
166
208
|
/**
|
|
167
209
|
* No native table beside your databases (ADR 0035 amendment of
|
|
168
210
|
* 2026-10-29). The source decides, never the row count: a database block
|
|
@@ -194,7 +236,19 @@ export interface DataSourcePickerService {
|
|
|
194
236
|
* Create a source in `databaseId`; it resolves to the new source, or
|
|
195
237
|
* `null`. Absent, the picker offers no "New source".
|
|
196
238
|
*/
|
|
197
|
-
createSource?(databaseId: string): Promise<DataSourcePickerSource | null>;
|
|
239
|
+
createSource?(databaseId: string, sourceName?: string): Promise<DataSourcePickerSource | null>;
|
|
240
|
+
/**
|
|
241
|
+
* Name a new source where it is created (ADR 0035 amendment of
|
|
242
|
+
* 2026-10-30): "New source", "New database", "With a new source" and
|
|
243
|
+
* "New empty source" open a step in the same menu cascade, a field
|
|
244
|
+
* opening on `suggest()`, your verdict under it and "Create", and pass
|
|
245
|
+
* the trimmed name to `createSource` / `createDatabase` as `sourceName`
|
|
246
|
+
* (the new database's first source). Enter creates when you say `'ok'`;
|
|
247
|
+
* Escape leaves the field and creates nothing. A call made outside
|
|
248
|
+
* those menus (the 0.61 slash entries) passes no name. Absent, the
|
|
249
|
+
* entries create at once and never pass a name, as in 2.0.
|
|
250
|
+
*/
|
|
251
|
+
sourceName?: DataSourcePickerSourceNaming;
|
|
198
252
|
/**
|
|
199
253
|
* Import a view of another database into `request.databaseId` (labre PRD
|
|
200
254
|
* REQ-DB-2, ADR 0035 amendment of 2026-10-14): the host lets the reader
|
|
@@ -224,6 +278,17 @@ export interface DataSourcePickerService {
|
|
|
224
278
|
* for a remote change. Nothing to confirm: it already happened.
|
|
225
279
|
*/
|
|
226
280
|
viewHistory?(view: DataSourcePickerViewRef, step: 'undo' | 'redo'): void;
|
|
281
|
+
/**
|
|
282
|
+
* What you lock on source `sourceId` of database `databaseId` (the
|
|
283
|
+
* view's stored `sourceId`; absent, your implicit source), as a signal:
|
|
284
|
+
* flip it and every open view of that source follows, without a reload.
|
|
285
|
+
* Read when a view of one of your databases (a block with an
|
|
286
|
+
* `externalSourceId`) is drawn or switches source. MUST return
|
|
287
|
+
* synchronously and MUST NOT throw; a throw reads as nothing locked.
|
|
288
|
+
* Absent, nothing is locked, as in 1.1 (ADR 0035 amendment of
|
|
289
|
+
* 2026-10-29).
|
|
290
|
+
*/
|
|
291
|
+
sourcePolicy?(databaseId: string, sourceId: string | undefined): ReadonlySignal<DataSourcePickerSourcePolicy>;
|
|
227
292
|
}
|
|
228
293
|
export declare const DataSourcePickerProvider: import("../../global/di/types.js").ServiceIdentifier<DataSourcePickerService> & (<U extends DataSourcePickerService = DataSourcePickerService>(variant: import("../../global/di/types.js").ServiceVariant) => import("../../global/di/types.js").ServiceIdentifier<U>);
|
|
229
294
|
/**
|
package/package.json
CHANGED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { InsertToPosition } from '../../../affine-shared/utils/index.js';
|
|
2
|
-
import { type ReadonlySignal } from '@preact/signals-core';
|
|
3
|
-
import { FilterTrait } from '../../core/filter/trait.js';
|
|
4
|
-
import { PropertyBase } from '../../core/view-manager/property.js';
|
|
5
|
-
import { type Row, RowBase } from '../../core/view-manager/row.js';
|
|
6
|
-
import { SingleViewBase } from '../../core/view-manager/single-view.js';
|
|
7
|
-
import type { ViewManager } from '../../core/view-manager/view-manager.js';
|
|
8
|
-
import type { CalendarEntry, CalendarEntryRange, CalendarExternalEntry, CalendarExternalSource, CalendarRowEntry, CalendarStoredViewData } from './types.js';
|
|
9
|
-
export type CalendarDateMapping = {
|
|
10
|
-
status: 'ready';
|
|
11
|
-
propertyId: string;
|
|
12
|
-
} | {
|
|
13
|
-
status: 'setup';
|
|
14
|
-
propertyId?: string;
|
|
15
|
-
};
|
|
16
|
-
export declare class CalendarSingleView extends SingleViewBase<CalendarStoredViewData> {
|
|
17
|
-
private readonly externalEntries$;
|
|
18
|
-
private externalEntriesRequestId;
|
|
19
|
-
propertiesRaw$: ReadonlySignal<CalendarProperty[]>;
|
|
20
|
-
properties$: ReadonlySignal<CalendarProperty[]>;
|
|
21
|
-
detailProperties$: ReadonlySignal<CalendarProperty[]>;
|
|
22
|
-
private readonly filter$;
|
|
23
|
-
private readonly sortList$;
|
|
24
|
-
emptyMonthHintDismissed$: ReadonlySignal<boolean>;
|
|
25
|
-
private readonly sortManager;
|
|
26
|
-
filterTrait: FilterTrait;
|
|
27
|
-
mainProperties$: ReadonlySignal<{
|
|
28
|
-
titleColumn: string | undefined;
|
|
29
|
-
}>;
|
|
30
|
-
readonly$: ReadonlySignal<boolean>;
|
|
31
|
-
dateProperties$: ReadonlySignal<CalendarProperty[]>;
|
|
32
|
-
dateMapping$: ReadonlySignal<CalendarDateMapping>;
|
|
33
|
-
startDateMapping$: ReadonlySignal<CalendarDateMapping>;
|
|
34
|
-
endDateMapping$: ReadonlySignal<CalendarDateMapping>;
|
|
35
|
-
private readonly visibleCardProperties$;
|
|
36
|
-
rowEntries$: ReadonlySignal<CalendarRowEntry[]>;
|
|
37
|
-
entries$: ReadonlySignal<CalendarEntry[]>;
|
|
38
|
-
externalSources$: ReadonlySignal<CalendarExternalSource[]>;
|
|
39
|
-
get type(): string;
|
|
40
|
-
constructor(viewManager: ViewManager, viewId: string);
|
|
41
|
-
isShow(rowId: string): boolean;
|
|
42
|
-
rowsMapping(rows: Row[]): Row[];
|
|
43
|
-
propertyGetOrCreate(propertyId: string): CalendarProperty;
|
|
44
|
-
rowGetOrCreate(rowId: string): CalendarRow;
|
|
45
|
-
setStartDateColumn(propertyId: string): void;
|
|
46
|
-
setDateColumn(propertyId: string): void;
|
|
47
|
-
setEndDateColumn(propertyId: string | undefined): void;
|
|
48
|
-
setWorkspaceCalendarEnabled(enabled: boolean): void;
|
|
49
|
-
setWorkspaceCalendarSubscriptionIds(subscriptionIds?: string[]): void;
|
|
50
|
-
dismissEmptyMonthHint(): void;
|
|
51
|
-
getDocDisplayTitle(docId: string): string;
|
|
52
|
-
createStartDateColumn(): string | undefined;
|
|
53
|
-
createDateColumn(): string | undefined;
|
|
54
|
-
createEndDateColumn(): string | undefined;
|
|
55
|
-
createRowOnDate(date: number | Date): string | undefined;
|
|
56
|
-
createLinkedDocRowOnDate(date: number | Date, docId: string): string | undefined;
|
|
57
|
-
moveRowToDate(rowId: string, date: number | Date): void;
|
|
58
|
-
resizeRowRange(rowId: string, edge: 'start' | 'end', date: number | Date): void;
|
|
59
|
-
loadExternalEntries(range: CalendarEntryRange): Promise<CalendarExternalEntry[]>;
|
|
60
|
-
}
|
|
61
|
-
export declare class CalendarProperty extends PropertyBase {
|
|
62
|
-
hide$: ReadonlySignal<boolean>;
|
|
63
|
-
constructor(view: CalendarSingleView, propertyId: string);
|
|
64
|
-
hideSet(_hide: boolean): void;
|
|
65
|
-
move(_position: InsertToPosition): void;
|
|
66
|
-
}
|
|
67
|
-
export declare class CalendarRow extends RowBase {
|
|
68
|
-
readonly calendarView: CalendarSingleView;
|
|
69
|
-
constructor(calendarView: CalendarSingleView, rowId: string);
|
|
70
|
-
}
|