@formicoidea/labre-core 0.55.0 → 0.56.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.
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Hand-written half of the library's architecture map (ADR 0040): the
|
|
2
|
+
// element and relationship kinds, and the views. Every element and relation
|
|
3
|
+
// lives in code.c4, generated by `yarn architecture`; a view here selects
|
|
4
|
+
// them by predicate (kind, scope, wildcard), never by naming a package or a
|
|
5
|
+
// folder, so a new package shows up without touching this file. A scoped
|
|
6
|
+
// view names its layer or family: a new packages/affine/<kind> folder (a new
|
|
7
|
+
// family) needs a new family view here.
|
|
8
|
+
specification {
|
|
9
|
+
element layer {
|
|
10
|
+
notation 'Layer: uses the layers below it, never above'
|
|
11
|
+
style {
|
|
12
|
+
color slate
|
|
13
|
+
opacity 10%
|
|
14
|
+
border dashed
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
element family {
|
|
18
|
+
notation 'Package family: packages/affine/<kind>'
|
|
19
|
+
style {
|
|
20
|
+
color slate
|
|
21
|
+
opacity 20%
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
element package {
|
|
25
|
+
notation 'Workspace package'
|
|
26
|
+
style {
|
|
27
|
+
color primary
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
element folder {
|
|
31
|
+
notation 'Folder under the package src/'
|
|
32
|
+
style {
|
|
33
|
+
color secondary
|
|
34
|
+
size small
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
relationship uses {
|
|
38
|
+
notation 'Package imports package (count of importing/imported file pairs)'
|
|
39
|
+
color primary
|
|
40
|
+
}
|
|
41
|
+
relationship imports {
|
|
42
|
+
notation 'Folder imports folder (count of importing/imported file pairs)'
|
|
43
|
+
color gray
|
|
44
|
+
line dotted
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
views {
|
|
49
|
+
// A view of packages excludes `imports` (folder to folder): those
|
|
50
|
+
// relations stay in the model for the relationship browser and the MCP
|
|
51
|
+
// tools, but would double every package edge on the diagram.
|
|
52
|
+
view index {
|
|
53
|
+
title 'blocksuite-labre: layers'
|
|
54
|
+
description 'Four layers, one direction, and the tooling above them. Click a layer to zoom.'
|
|
55
|
+
include *
|
|
56
|
+
exclude * -> * where kind is imports
|
|
57
|
+
autoLayout BottomTop
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
view layer-framework of framework {
|
|
61
|
+
title 'framework/*'
|
|
62
|
+
include *
|
|
63
|
+
exclude * -> * where kind is imports
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// A layer of one package shows that package's folders instead.
|
|
67
|
+
view layer-model of model_ {
|
|
68
|
+
title 'affine/model'
|
|
69
|
+
description 'The file format, folder by folder.'
|
|
70
|
+
include model_.**
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
view layer-features of features {
|
|
74
|
+
title 'affine/* features'
|
|
75
|
+
description 'Package families and standalone feature packages.'
|
|
76
|
+
include *
|
|
77
|
+
exclude * -> * where kind is imports
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// A family view shows its packages and the edges among them only: the
|
|
81
|
+
// edges to every package outside the family flatten the diagram.
|
|
82
|
+
view family-blocks of features.blocks {
|
|
83
|
+
title 'affine/blocks'
|
|
84
|
+
include features.blocks.*
|
|
85
|
+
exclude * -> * where kind is imports
|
|
86
|
+
autoLayout LeftRight
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
view family-fragments of features.fragments {
|
|
90
|
+
title 'affine/fragments'
|
|
91
|
+
include features.fragments.*
|
|
92
|
+
exclude * -> * where kind is imports
|
|
93
|
+
autoLayout LeftRight
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
view family-gfx of features.gfx {
|
|
97
|
+
title 'affine/gfx'
|
|
98
|
+
include features.gfx.*
|
|
99
|
+
exclude * -> * where kind is imports
|
|
100
|
+
autoLayout LeftRight
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
view family-inlines of features.inlines {
|
|
104
|
+
title 'affine/inlines'
|
|
105
|
+
include features.inlines.*
|
|
106
|
+
exclude * -> * where kind is imports
|
|
107
|
+
autoLayout LeftRight
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
view family-widgets of features.widgets {
|
|
111
|
+
title 'affine/widgets'
|
|
112
|
+
include features.widgets.*
|
|
113
|
+
exclude * -> * where kind is imports
|
|
114
|
+
autoLayout LeftRight
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
view layer-assembly of assembly {
|
|
118
|
+
title 'affine/all'
|
|
119
|
+
description 'The assembly, folder by folder.'
|
|
120
|
+
include assembly.**
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
view layer-tooling of tooling {
|
|
124
|
+
title 'tooling'
|
|
125
|
+
include *
|
|
126
|
+
exclude * -> * where kind is imports
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -2,11 +2,23 @@ import isMatch from 'lodash.ismatch';
|
|
|
2
2
|
export function runQuery(query, block) {
|
|
3
3
|
const blockViewType = getBlockViewType(query, block);
|
|
4
4
|
block.blockViewType = blockViewType;
|
|
5
|
-
if (blockViewType !== 'hidden') {
|
|
5
|
+
if (blockViewType !== 'hidden' && canHideBlocks(query)) {
|
|
6
6
|
const queryMode = query.mode;
|
|
7
7
|
setAncestorsToDisplayIfHidden(queryMode, block);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* A loose query hides a block only through a `viewType: 'hidden'` entry, so
|
|
12
|
+
* without one no ancestor can be hidden and the walk below is a no-op. The
|
|
13
|
+
* walk costs one O(n) `getParent` per ancestor, which made opening a store
|
|
14
|
+
* with the default query quadratic in the block count (#507, guard
|
|
15
|
+
* `__tests__/query.unit.spec.ts`).
|
|
16
|
+
*/
|
|
17
|
+
function canHideBlocks(query) {
|
|
18
|
+
if (query.mode !== 'loose')
|
|
19
|
+
return true;
|
|
20
|
+
return query.match.some(entry => entry.viewType === 'hidden');
|
|
21
|
+
}
|
|
10
22
|
function getBlockViewType(query, block) {
|
|
11
23
|
const flavour = block.model.flavour;
|
|
12
24
|
const id = block.model.id;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formicoidea/labre-core",
|
|
3
3
|
"description": "Labre editor — the full BlockSuite-derived editor as one package.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.56.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "lajola",
|
|
@@ -904,7 +904,8 @@
|
|
|
904
904
|
}
|
|
905
905
|
},
|
|
906
906
|
"files": [
|
|
907
|
-
"dist"
|
|
907
|
+
"dist",
|
|
908
|
+
"architecture"
|
|
908
909
|
],
|
|
909
910
|
"dependencies": {
|
|
910
911
|
"@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
|