@formicoidea/labre-core 0.37.0 → 0.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_pkgs/affine-block-frame/frame-manager.d.ts +31 -0
- package/dist/_pkgs/affine-block-frame/frame-manager.js +62 -2
- package/dist/_pkgs/affine-block-frame/frame-tool.js +6 -2
- package/dist/_pkgs/affine-block-surface/extensions/audit.js +12 -34
- package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +12 -12
- package/dist/_pkgs/affine-block-surface/extensions/reading.js +10 -28
- package/dist/_pkgs/affine-block-surface/extensions/validation.d.ts +321 -16
- package/dist/_pkgs/affine-block-surface/extensions/validation.js +945 -62
- package/dist/_pkgs/affine-block-surface/framework-background/facts.d.ts +24 -0
- package/dist/_pkgs/affine-block-surface/framework-background/facts.js +31 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.d.ts +131 -0
- package/dist/_pkgs/affine-block-surface/framework-background/stacking.js +184 -0
- package/dist/_pkgs/affine-block-surface/utils/sort.d.ts +15 -1
- package/dist/_pkgs/affine-block-surface/utils/sort.js +30 -31
- package/dist/_pkgs/affine-block-surface/view.js +5 -0
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
- package/dist/_pkgs/affine-components/icons/text.js +426 -426
- package/dist/_pkgs/affine-gfx-group/element-renderer/utils.js +3 -1
- package/dist/_pkgs/affine-gfx-template/index.d.ts +1 -0
- package/dist/_pkgs/affine-gfx-template/index.js +1 -0
- package/dist/_pkgs/affine-gfx-template/make-snapshot.d.ts +16 -2
- package/dist/_pkgs/affine-gfx-template/make-snapshot.js +43 -4
- package/dist/_pkgs/affine-gfx-template/services/template-middlewares.js +1 -0
- package/dist/_pkgs/affine-gfx-template/services/template.d.ts +6 -0
- package/dist/_pkgs/affine-gfx-template/services/template.js +6 -0
- package/dist/_pkgs/affine-gfx-template/snapshot-from-action.d.ts +20 -0
- package/dist/_pkgs/affine-gfx-template/snapshot-from-action.js +205 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/template-panel.js +4 -0
- package/dist/_pkgs/affine-gfx-template/toolbar/template-type.d.ts +13 -0
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.d.ts +11 -17
- package/dist/_pkgs/affine-inline-link/link-node/configs/toolbar.js +55 -14
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.d.ts +9 -20
- package/dist/_pkgs/affine-model/elements/cynefin/cynefin.js +7 -28
- package/dist/_pkgs/affine-model/elements/edgy/board.d.ts +9 -21
- package/dist/_pkgs/affine-model/elements/edgy/board.js +8 -29
- package/dist/_pkgs/affine-model/elements/edgy/facets.d.ts +14 -28
- package/dist/_pkgs/affine-model/elements/edgy/facets.js +12 -36
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.d.ts +9 -19
- package/dist/_pkgs/affine-model/elements/estuarine/estuarine.js +7 -27
- package/dist/_pkgs/affine-shared/services/link-preview-service/link-preview-service.d.ts +28 -0
- package/dist/_pkgs/affine-shared/services/link-preview-service/link-preview-service.js +20 -3
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +124 -124
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/index.js +26 -26
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +10 -10
- package/dist/_pkgs/affine-widget-viewport-overlay/index.js +13 -13
- package/dist/_pkgs/data-view/core/group-by/renderer/boolean-group.js +11 -11
- package/dist/_pkgs/data-view/core/utils/menu-title.js +17 -17
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +18 -18
- package/dist/_pkgs/std/gfx/model/surface/surface-model.js +12 -2
- package/package.json +1 -1
|
@@ -2,21 +2,21 @@ import { CheckBoxCheckSolidIcon, CheckBoxUnIcon } from '@blocksuite/icons/lit';
|
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
3
|
import { BaseGroup } from './base.js';
|
|
4
4
|
export class BooleanGroupView extends BaseGroup {
|
|
5
|
-
static { this.styles = css `
|
|
6
|
-
.data-view-group-title-boolean-view {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
}
|
|
10
|
-
.data-view-group-title-boolean-view svg {
|
|
11
|
-
width: 20px;
|
|
12
|
-
height: 20px;
|
|
13
|
-
}
|
|
5
|
+
static { this.styles = css `
|
|
6
|
+
.data-view-group-title-boolean-view {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
.data-view-group-title-boolean-view svg {
|
|
11
|
+
width: 20px;
|
|
12
|
+
height: 20px;
|
|
13
|
+
}
|
|
14
14
|
`; }
|
|
15
15
|
render() {
|
|
16
|
-
return html ` <div class="data-view-group-title-boolean-view">
|
|
16
|
+
return html ` <div class="data-view-group-title-boolean-view">
|
|
17
17
|
${this.value
|
|
18
18
|
? CheckBoxCheckSolidIcon({ style: `color:#1E96EB` })
|
|
19
|
-
: CheckBoxUnIcon()}
|
|
19
|
+
: CheckBoxUnIcon()}
|
|
20
20
|
</div>`;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ArrowLeftBigIcon } from '@blocksuite/icons/lit';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
export const menuTitle = (name, onBack) => {
|
|
4
|
-
return html `
|
|
5
|
-
<div
|
|
6
|
-
style="display:flex;align-items:center;gap: 4px;padding: 3px 3px 3px 2px"
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
@click=${onBack}
|
|
10
|
-
class="dv-icon-20 dv-hover dv-pd-2 dv-round-4"
|
|
11
|
-
style="display:flex;"
|
|
12
|
-
>
|
|
13
|
-
${ArrowLeftBigIcon()}
|
|
14
|
-
</div>
|
|
15
|
-
<div
|
|
16
|
-
style="font-weight:500;font-size: 14px;line-height: 22px;color: var(--affine-text-primary-color)"
|
|
17
|
-
>
|
|
18
|
-
${name}
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
4
|
+
return html `
|
|
5
|
+
<div
|
|
6
|
+
style="display:flex;align-items:center;gap: 4px;padding: 3px 3px 3px 2px"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
@click=${onBack}
|
|
10
|
+
class="dv-icon-20 dv-hover dv-pd-2 dv-round-4"
|
|
11
|
+
style="display:flex;"
|
|
12
|
+
>
|
|
13
|
+
${ArrowLeftBigIcon()}
|
|
14
|
+
</div>
|
|
15
|
+
<div
|
|
16
|
+
style="font-weight:500;font-size: 14px;line-height: 22px;color: var(--affine-text-primary-color)"
|
|
17
|
+
>
|
|
18
|
+
${name}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
21
|
`;
|
|
22
22
|
};
|
|
@@ -19,9 +19,9 @@ export const GroupTitle = (groupData, ops) => {
|
|
|
19
19
|
}
|
|
20
20
|
const icon = groupData.value == null
|
|
21
21
|
? ''
|
|
22
|
-
: html ` <uni-lit
|
|
23
|
-
class="${groupHeaderIcon}"
|
|
24
|
-
.uni="${groupData.property.icon}"
|
|
22
|
+
: html ` <uni-lit
|
|
23
|
+
class="${groupHeaderIcon}"
|
|
24
|
+
.uni="${groupData.property.icon}"
|
|
25
25
|
></uni-lit>`;
|
|
26
26
|
const props = {
|
|
27
27
|
group: groupData,
|
|
@@ -29,25 +29,25 @@ export const GroupTitle = (groupData, ops) => {
|
|
|
29
29
|
};
|
|
30
30
|
const showColumnName = groupData.property.type$.value === 'checkbox';
|
|
31
31
|
const columnName = showColumnName
|
|
32
|
-
? html `<span class="${groupHeaderTitle}"
|
|
33
|
-
>${groupData.property.name$.value}</span
|
|
32
|
+
? html `<span class="${groupHeaderTitle}"
|
|
33
|
+
>${groupData.property.name$.value}</span
|
|
34
34
|
>`
|
|
35
35
|
: nothing;
|
|
36
36
|
const opsClass = clsx(ops.groupHover && show, groupHeaderOps);
|
|
37
|
-
return html `
|
|
38
|
-
<div class="${groupTitleRow}">
|
|
39
|
-
${icon} ${renderUniLit(view, props)} ${columnName}
|
|
40
|
-
${GroupHeaderCount(groupData)}
|
|
41
|
-
</div>
|
|
37
|
+
return html `
|
|
38
|
+
<div class="${groupTitleRow}">
|
|
39
|
+
${icon} ${renderUniLit(view, props)} ${columnName}
|
|
40
|
+
${GroupHeaderCount(groupData)}
|
|
41
|
+
</div>
|
|
42
42
|
${!ops.readonly
|
|
43
|
-
? html ` <div class="${opsClass}">
|
|
44
|
-
<div @click="${ops.clickAdd}" class="${groupHeaderOp}">
|
|
45
|
-
${PlusIcon()}
|
|
46
|
-
</div>
|
|
47
|
-
<div @click="${ops.clickOps}" class="${groupHeaderOp}">
|
|
48
|
-
${MoreHorizontalIcon()}
|
|
49
|
-
</div>
|
|
43
|
+
? html ` <div class="${opsClass}">
|
|
44
|
+
<div @click="${ops.clickAdd}" class="${groupHeaderOp}">
|
|
45
|
+
${PlusIcon()}
|
|
46
|
+
</div>
|
|
47
|
+
<div @click="${ops.clickOps}" class="${groupHeaderOp}">
|
|
48
|
+
${MoreHorizontalIcon()}
|
|
49
|
+
</div>
|
|
50
50
|
</div>`
|
|
51
|
-
: nothing}
|
|
51
|
+
: nothing}
|
|
52
52
|
`;
|
|
53
53
|
};
|
|
@@ -510,7 +510,10 @@ export class SurfaceBlockModel extends BlockModel {
|
|
|
510
510
|
if (isGfxGroupCompatibleModel(payload.model)) {
|
|
511
511
|
this._groupLikeModels.delete(payload.id);
|
|
512
512
|
}
|
|
513
|
-
|
|
513
|
+
// Same rule as `_watchGroupRelationChange`: the author already
|
|
514
|
+
// dropped the block from its group, and `removeChild` is a raw
|
|
515
|
+
// `transact` — on a readonly viewer it would be a silent write.
|
|
516
|
+
if (payload.isLocal) {
|
|
514
517
|
const group = this.getGroup(payload.id);
|
|
515
518
|
if (group) {
|
|
516
519
|
// oxlint-disable-next-line unicorn/prefer-dom-node-remove
|
|
@@ -563,7 +566,14 @@ export class SurfaceBlockModel extends BlockModel {
|
|
|
563
566
|
}
|
|
564
567
|
_watchGroupRelationChange() {
|
|
565
568
|
const isGroup = (element) => element instanceof GfxGroupLikeElementModel;
|
|
566
|
-
const disposable = this.elementUpdated.subscribe(({ id, oldValues }) => {
|
|
569
|
+
const disposable = this.elementUpdated.subscribe(({ id, oldValues, local }) => {
|
|
570
|
+
// A cascade belongs to the peer that made the change: the author's own
|
|
571
|
+
// watcher deletes the group it emptied, and that deletion arrives with
|
|
572
|
+
// the same sync. Reacting to a REMOTE update with a local write is
|
|
573
|
+
// redundant on a writeable peer and, on a readonly viewer, the
|
|
574
|
+
// production exception `Cannot remove element in readonly mode`.
|
|
575
|
+
if (!local)
|
|
576
|
+
return;
|
|
567
577
|
const element = this.getElementById(id);
|
|
568
578
|
if (isGroup(element) &&
|
|
569
579
|
oldValues['childIds'] &&
|